package com.zhentao.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zhentao.mapper.ApActiveMapper;
import com.zhentao.model.common.dtos.ResponseResult;
import com.zhentao.model.common.manger.pojo.Activity;
import com.zhentao.service.ApActiveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ApActiveServiceImpl implements ApActiveService {
    @Autowired
    private ApActiveMapper apActiveMapper;

    @Override
    public ResponseResult activeFindAll() {
        LambdaQueryWrapper<Activity>queryWrapper=new LambdaQueryWrapper<>();
        queryWrapper.orderByDesc(Activity::getCreateTime);
        List<Activity> activities = apActiveMapper.selectList(queryWrapper);
        return ResponseResult.okResult(activities);
    }
}
